import Vue from "vue"
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import Home from '@/pages/Home'
import List from '@/pages/List'
import Cart from '@/pages/Cart'
import My from '@/pages/My'
import Login from '@/pages/Login'
import Logon from '@/pages/Login/Logon'
import Search from '@/pages/Search'
import SearchHistory from '@/pages/Search/SearchHistory'
import SearchList from '@/pages/Search/SearchList'
import ClassifyList from '@/pages/List/ClassifyList'
import Ware from '@/pages/Ware'


const routes = [
	{
		path:'/',
		redirect:'/home'
	},
	
	{
		path:"/home",
		name:'home',
		component:Home,
	},
	{
		path:"/list",
		name:'list',
		component:List,
	},
	{
		path:'/classifylist',
		name:'classifylist',
		component:ClassifyList
	},
	{
		path:"/cart",
		name:'cart',
		component:Cart,
	},
	{
		path:"/my",
		name:'my',
		component:My,
	},
	{
		path:"/search",
		// name:'search',
		component:Search,
		children:[
			{
				path:'/',
				name:'searchHistory',
				component:SearchHistory
			},
			{
				path:'searchlist',
				name:'searchList',
				component:SearchList
			},
		]
	},
	{
		path:'/ware',
		name:'ware',
		component:Ware
	},
	{
		path:'/login',
		name:'login',
		component:Login,
	},
	{
		path:'/logon',
		name:'logon',
		component:Logon,
	}
]

const router = new VueRouter({
	routes
})

export default router